package com.xian.cloud.controller;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 *
 * @Author: xlr
 * @Date: Created in 上午11:29 2018/10/27
 */
@RestController
@RequestMapping("rabbit")
public class TestController {

    @Autowired
    private AmqpTemplate rabbitTemplate;

    @Value( "${sss}" )
    String sss;

    @RequestMapping(value = "send",method = RequestMethod.GET)
    public void send(@RequestParam("message") String message){
        rabbitTemplate.convertAndSend( "queue",message);
        System.out.println(sss);
    }


}
